1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module adw.CarouselIndicatorLines;
26 
27 private import adw.Carousel;
28 private import adw.c.functions;
29 public  import adw.c.types;
30 private import glib.ConstructionException;
31 private import gobject.ObjectG;
32 private import gtk.AccessibleIF;
33 private import gtk.AccessibleT;
34 private import gtk.BuildableIF;
35 private import gtk.BuildableT;
36 private import gtk.ConstraintTargetIF;
37 private import gtk.ConstraintTargetT;
38 private import gtk.OrientableIF;
39 private import gtk.OrientableT;
40 private import gtk.Widget;
41 
42 
43 /**
44  * A lines indicator for [class@Carousel].
45  * 
46  * <picture>
47  * <source srcset="carousel-indicator-dots-lines.png" media="(prefers-color-scheme: dark)">
48  * <img src="carousel-indicator-lines.png" alt="carousel-indicator-lines">
49  * </picture>
50  * 
51  * The `AdwCarouselIndicatorLines` widget shows a set of lines for each page of
52  * a given [class@Carousel]. The carousel's active page is shown as another line
53  * that moves between them to match the carousel's position.
54  * 
55  * See also [class@CarouselIndicatorDots].
56  * 
57  * ## CSS nodes
58  * 
59  * `AdwCarouselIndicatorLines` has a single CSS node with name
60  * `carouselindicatorlines`.
61  *
62  * Since: 1.0
63  */
64 public class CarouselIndicatorLines : Widget, OrientableIF
65 {
66 	/** the main Gtk struct */
67 	protected AdwCarouselIndicatorLines* adwCarouselIndicatorLines;
68 
69 	/** Get the main Gtk struct */
70 	public AdwCarouselIndicatorLines* getCarouselIndicatorLinesStruct(bool transferOwnership = false)
71 	{
72 		if (transferOwnership)
73 			ownedRef = false;
74 		return adwCarouselIndicatorLines;
75 	}
76 
77 	/** the main Gtk struct as a void* */
78 	protected override void* getStruct()
79 	{
80 		return cast(void*)adwCarouselIndicatorLines;
81 	}
82 
83 	/**
84 	 * Sets our main struct and passes it to the parent class.
85 	 */
86 	public this (AdwCarouselIndicatorLines* adwCarouselIndicatorLines, bool ownedRef = false)
87 	{
88 		this.adwCarouselIndicatorLines = adwCarouselIndicatorLines;
89 		super(cast(GtkWidget*)adwCarouselIndicatorLines, ownedRef);
90 	}
91 
92 	// add the Orientable capabilities
93 	mixin OrientableT!(AdwCarouselIndicatorLines);
94 
95 
96 	/** */
97 	public static GType getType()
98 	{
99 		return adw_carousel_indicator_lines_get_type();
100 	}
101 
102 	/**
103 	 * Creates a new `AdwCarouselIndicatorLines`.
104 	 *
105 	 * Returns: the newly created `AdwCarouselIndicatorLines`
106 	 *
107 	 * Since: 1.0
108 	 *
109 	 * Throws: ConstructionException GTK+ fails to create the object.
110 	 */
111 	public this()
112 	{
113 		auto __p = adw_carousel_indicator_lines_new();
114 
115 		if(__p is null)
116 		{
117 			throw new ConstructionException("null returned by new");
118 		}
119 
120 		this(cast(AdwCarouselIndicatorLines*) __p);
121 	}
122 
123 	/**
124 	 * Gets the displayed carousel.
125 	 *
126 	 * Returns: the displayed carousel
127 	 *
128 	 * Since: 1.0
129 	 */
130 	public Carousel getCarousel()
131 	{
132 		auto __p = adw_carousel_indicator_lines_get_carousel(adwCarouselIndicatorLines);
133 
134 		if(__p is null)
135 		{
136 			return null;
137 		}
138 
139 		return ObjectG.getDObject!(Carousel)(cast(AdwCarousel*) __p);
140 	}
141 
142 	/**
143 	 * Sets the displayed carousel.
144 	 *
145 	 * Params:
146 	 *     carousel = a carousel
147 	 *
148 	 * Since: 1.0
149 	 */
150 	public void setCarousel(Carousel carousel)
151 	{
152 		adw_carousel_indicator_lines_set_carousel(adwCarouselIndicatorLines, (carousel is null) ? null : carousel.getCarouselStruct());
153 	}
154 }